package com.xbh.realtime.tio.messageQueue;

import com.xbh.realtime.tio.websocket.MyWSConfig;
import org.tio.core.ChannelContext;
import org.tio.core.Tio;
import org.tio.websocket.common.WsResponse;

/**
 * @TioNewLinkThread: 新创建连接后 推送的消息
 * @author: ZBoHang
 * @time: 2021/8/11 15:21
 */
public class TioNewLinkThread extends Thread {

    private ChannelContext channelContext;

    public TioNewLinkThread(ChannelContext channelContext) {
        this.channelContext = channelContext;
    }

    @Override
    public void run() {
        WsResponse wsResponse = WsResponse.fromText("* * * * * 欢迎进入 # # 聊天平台 * * * * *", MyWSConfig.characterPattern);
        Tio.send(channelContext, wsResponse);
    }
}
